package com.patter.demo.factory.abstracts;

import com.patter.demo.factory.Circle;
import com.patter.demo.factory.Rectangle;
import com.patter.demo.factory.Shape;
import com.patter.demo.factory.Square;

/**
 * @Author create by xcb 2023/1/29 11:28
 */
public class ShapeFactory extends AbstractFactory {

    @Override
    public Colour getColour(String colour) {
        return null;
    }

    @Override
    public Shape getShapes(String shapeType) {
        if (shapeType == null) {
            return null;
        }
        if (shapeType.equalsIgnoreCase("CIRCLE")) {
            return new Circle();
        } else if (shapeType.equalsIgnoreCase("RECTANGLE")) {
            return new Rectangle();
        } else if (shapeType.equalsIgnoreCase("SQUARE")) {
            return new Square();
        } else {
            return null;
        }
    }
}
